package com.city.repository.supervise;


import com.city.domain.supervise.ImpLocation;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author: Xln_z
 * @date: 2018/8/16
 * @decription:地点管理
 **/
@Repository
public interface ImpLocationRepository extends JpaRepository<ImpLocation, Integer> {

    @Query(value = "select * from imp_location_manage limit ?1,?2 ", nativeQuery = true)
    List<ImpLocation> getImpLocationLimit(Integer limitPage, Integer limitNum);

    @Query(value = "select * from imp_location_manage where (loname like %?3% or tellphone like %?3%) limit ?1,?2 ", nativeQuery = true)
    List<ImpLocation> getImpLocationLimit(Integer limitPage, Integer limitNum, String search);

    @Query(value = "select * from imp_location_manage ", nativeQuery = true)
    List<ImpLocation> getAll();

    ImpLocation getByLoname(String loname);

}
